import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { ModelPageList, ModelManual } from "./types";

// 回传记录 - 获取订单流水
export function payOrderList(
  data: ModelPageList
): AxiosPromise<Record<string, any>> {
  return request({
    url: "/api/callback/pay_order/search",
    method: "post",
    data,
  });
}

// 回传记录 - 获取注册流水
export function registeredList(
  data: ModelPageList
): AxiosPromise<Record<string, any>> {
  return request({
    url: "/api/callback/registered/search",
    method: "post",
    data,
  });
}

// 回传记录 - 获取订单补单数量
export function orderCount(
  data: ModelPageList
): AxiosPromise<Record<string, any>> {
  return request({
    url: `/api/callback/pay_order/manual/batch/count`,
    method: "post",
    data,
  });
}

// 回传记录 - 订单批量补单
export function orderBatch(
  data: ModelPageList
): AxiosPromise<Record<string, any>> {
  return request({
    url: `/api/callback/pay_order/manual/batch`,
    method: "post",
    data,
  });
}

// 回传记录 - 订单流水补单
export function payorderManual(
  data: number
): AxiosPromise<Record<string, any>> {
  return request({
    url: `/api/callback/pay_order/manual/${data}`,
    method: "post",
  });
}

// 回传记录 - 注册流水补单
export function registeredManual(
  data: ModelManual
): AxiosPromise<Record<string, any>> {
  return request({
    url: `/api/callback/registered/manual/${data.id}?amount=${data.amount}`,
    method: "post",
  });
}
